<extend name="Public/content" />
<block name="style">
<style type="text/css" >
    .red{color: red;}
    body{ background: #fff;}
    .footer {
    width: 100%;
    height: 50px;
    position: fixed;
    bottom: 0;
   
    left: 0;
    line-height: 50px;
    text-align: right;
    text-align: right;
    border-top: solid 1px #eee;
    padding-right: 10px;
    z-index: 999999999999999;
}
</style>
</block>
<block name="body">
    <!-- 弹窗插件 -->
    <include file="Public:artdialog" />
    <!-- 表单验证插件 
    <include file="Public:validform" />-->

    <div class="row">
    <div class="col-md-9">
        <div class="block-web">
            <div class="header">
                <h3 class="content-header"><if condition="$is_add eq 0">新增<else/>编辑</if>菜单</h3>
            </div>
            <div class="porlets-content">
                <form class="form-horizontal row-border vform" action="{:U('Nav/add_menu')}" method="post">
                     <input type="hidden" name="is_add" value="{$is_add}">
                    <input type="hidden" name="id" value="{$m['id']}">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">菜单名称</label>
                        <div class="col-sm-8">
                            <input type="text" name="name" class="form-control"  value="{$m['name']}" datatype="*"   nullmsg="请输入菜单名称！" >
                            <div class="Validform_checktip"></div>
                        </div>
                        <div class="col-sm-1">
                            <span class="red">*</span>
                        </div>
                    </div><!--/form-group-->
                    <div class="form-group">
                        <label class="col-sm-3 control-label">菜单地址</label>
                        <div class="col-sm-8">
                            <input type="text" name="name_url" class="form-control"  value="{$m['name_url']}"   nullmsg="请输入菜单地址" sucmsg="菜单地址验证通过！">
                            <div class="Validform_checktip"></div>
                        </div>
                        <div class="col-sm-1">
                            <span class="red"></span>
                        </div>
                    </div><!--/form-group-->
                    <div class="form-group">
                        <label class="col-sm-3 control-label">排序</label>
                        <div class="col-sm-8">
                            <input type="text" name="sort" class="form-control" value="{$m['sort']|default='0'}" datatype="n" nullmsg="请输入排序">
                            <div class="Validform_checktip"></div>
                        </div>
                        <div class="col-sm-1">
                            <span class="red">*</span>
                        </div>
                    </div><!--/form-group-->
                    <div class="form-group">
                        <label class="col-sm-3 control-label">排序</label>
                        <div class="col-sm-8">
                            <input type="text" name="sort" class="form-control" value="{$m['sort']|default='0'}" datatype="n" nullmsg="请输入排序">
                            <div class="Validform_checktip"></div>
                        </div>
                        <div class="col-sm-1">
                            <span class="red">*</span>
                        </div>
                    </div><!--/form-group-->

                    <div class="form-group">
                        <label class="col-sm-3 control-label">父级菜单</label>
                        <div class="col-sm-8">
                            <select    id="parent_id" name="parent_id" class="form-control" style="height: 35px;" >
                                    <option value="0">顶级菜单 </option>
                                    <volist name="parentlist" id="m">
                                        <option value="{$m['id']}">
                                            {:print_nbsp($m['count'])}|-{$m['name']}</option>
                                    </volist>
                            </select>
                        </div><!--/col-sm-9-->

                        <div class="col-sm-1">
                            <span class="red">*</span>
                        </div>
                    </div>

                    <if condition="$is_add eq 1">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">是否有效</label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio"  <if condition="$status eq 1">checked</if> name="closed" value="1" id="inlineradio1" >
                                    <span class="custom-radio"></span> 启用 </label>
                                <label class="radio-inline">
                                    <input type="radio"  name="closed"  <if condition="$status eq 0">checked</if>  value="0" id="inlineradio2">
                                    <span class="custom-radio"></span> 禁止 </label>
                            </div>
                        </div>
                        <else/>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">是否有效</label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio"  checked name="closed" value="1" id="inlineradio1" >
                                    <span class="custom-radio"></span> 启用 </label>
                                <label class="radio-inline">
                                    <input type="radio"  name="closed" value="0" id="inlineradio2">
                                    <span class="custom-radio"></span> 禁止 </label>
                            </div>
                        </div>
                    </if>

                    <if condition="$is_add eq 1">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">是否显示</label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio"  <if condition="$is_display  eq 1">checked</if> name="is_menu" value="1" id="inlineradio1" >
                                    <span class="custom-radio"></span> 启用 </label>
                                <label class="radio-inline">
                                    <input type="radio"  name="is_menu"  <if condition="$is_display  eq 0">checked</if>  value="0" id="inlineradio2">
                                    <span class="custom-radio"></span> 禁止 </label>
                            </div>
                        </div>
                        <else/>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">是否显示</label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input type="radio" checked   name="is_menu" value="1" id="inlineradio1" >
                                    <span class="custom-radio"></span> 启用 </label>
                                <label class="radio-inline">
                                    <input type="radio"  name="is_menu"  value="0" id="inlineradio2">
                                    <span class="custom-radio"></span> 禁止 </label>
                            </div>
                        </div>
                    </if>
                    <div class="footer" >
                        <button class="btn btn-primary btn-success bt_submit" type="submit">提交</button>
                        <button class="btn btn-default bt_close" type="button" onclick="art.dialog.open.api.close();" >关闭</button>
                    </div>
                </form>
            </div><!--/porlets-content-->
        </div><!--/block-web-->
    </div><!--/col-md-6-->

    </div>

</block>
<block name="script">
    <script type="text/javascript">
        <if condition="$parent_id neq 0">
                $(function(){
                    $("#parent_id option[value={$parent_id}]").attr("selected", "selected");

                });
        </if>

        <if condition="$is_add eq 1">
                $(function(){
                    $("#parent_id").attr("disabled","disabled");
                });
        </if>
    </script>
</block>